<template>
    <div>
        <h3>新闻列表页面</h3>
        <ul class="mui-table-view">
			<li class="mui-table-view-cell mui-media" v-for="item in newsList" :key="item.id">
				<router-link :to="'/home/newsInfo/'+item.id">
					<img class="mui-media-object mui-pull-left" :src="item.url">
					<div class="mui-media-body">
                        <h1>{{item.title}}</h1>
						<p class='mui-ellipsis'>
                            <span>发表时间：{{item.add_time}}</span>
                            <span>点击次数：{{item.click}}次</span>
                        </p>
					</div>
				</router-link>
			</li>
        </ul>
    </div>
</template>

<script>
import { Toast } from 'mint-ui'
export default {
    data(){
        return {
            newsList:[
                {
                    id:1,
                    click:1,
                    title:'中央批准最高检内设机构改革方案，增设未成年人检察机构',
                    add_time:'2018-12-14 16:53',
                    url:'http://img2.imgtn.bdimg.com/it/u=4188550621,259048427&fm=26&gp=0.jpg'
                },
                {
                    id:2,
                    click:0,
                    title:'国家统计局：今年全年实现6.5%左右的增长目标没有悬念',
                    add_time:'2018-12-14 12:21:52',
                    url:'http://img5.imgtn.bdimg.com/it/u=2427832363,3158834894&fm=26&gp=0.jpg'
                },
                {
                    id:3,
                    click:13,
                    title:'重庆一“断指保安”作画感动无数人，超过10万抖音网友点赞：有梦想谁都了不起',
                    add_time:'2018-12-14 18:21:52',
                    url:'https://p99.pstatp.com/list/190x124/pgc-image/RC6lHW9HndCkpK'
                },
                {
                    id:4,
                    click:40,
                    title:'财政部原副部长张少春受贿案一审开庭',
                    add_time:'2018-12-14 15:53:22',
                    url:'https://p99.pstatp.com/list/190x124/pgc-image/7d08f0427ec442bba23e1b43563f0e69'
                },
                {
                    id:5,
                    click:1,
                    title:'“幼儿被拖至监控盲区殴打”，株洲幼儿园：涉事班教师全开除',
                    add_time:' 2018-12-14 12:38:27',
                    url:'https://p99.pstatp.com/list/190x124/pgc-image/RCAzC8p2vy6JTW'
                }
            ]
        }
    },
    created(){
        // getNews()
    },
    methods:{
        // getNews(){
        //     this.$http.get('url').then(res=>{
        //         if(res.body.status==0){
        //             this.newsList =  res.body.message;
        //         }else{
        //             Toast('获取新闻列表失败')
        //         }
        //     })
        // }
    }
    
}
</script>

<style lang="less" scoped>
.mui-table-view{
    h1{
        font-size: 14px;
    }
    .mui-ellipsis{
        font-size: 12px;
        color:#226aff;
        display: flex;
        justify-content: space-between;
    }
}
</style>


